home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / windows / dialbk.zip / DIALBACK.WAS next >
Text File  |  1992-08-10  |  2KB  |  72 lines

  1. Here is an example of a dialback script.  This is for use
  2. on computer systems which require you to call them, and 
  3. they call you back at a pre-specified phone number. 
  4.  
  5. ; Dialback script 
  6. ; This script will log in to a dialback system,
  7. ; wait for the dialback, answer, and login
  8.  
  9. ; To modify this script for your system,
  10. ; change the dialback_login and login procedures
  11. ; to your needs.  An example is shown of the logins
  12. ; needed for my company's system.
  13.  
  14. #define RINGS_TO_ANSWER 1
  15.  
  16. integer answered=0,ring=0
  17.  
  18. proc main
  19.     call dialback_login
  20.     when cdchanges call carrierdrop
  21.     while 1  
  22.     endwhile
  23. endproc
  24.  
  25. proc carrierdrop
  26.     call wait_for_dialback
  27.     call login
  28. endproc
  29.  
  30. proc wait_for_dialback
  31.     statmsg "Waiting for dialback"
  32.     transmit "+++"
  33.     pause 2
  34.     transmit "ATE1^M"
  35.     when target 0 "RING" call ring_indicated
  36.     while !answered                    ; Check answered flag while looping
  37.         if ring > 0
  38.             statmsg "%d ring" ring     ; Display number of rings
  39.     endif
  40.     endwhile
  41. endproc
  42.  
  43. proc ring_indicated
  44.    ring++                              ; Increment the ring counter
  45.    if ring >= RINGS_TO_ANSWER          ; Answer on the nth ring
  46.       transmit "ATA^M"
  47.       answered=1
  48.       clearwhen target 0
  49.    endif
  50. endproc
  51.  
  52. proc dialback_login
  53.     ; Your first login into the dialback system 
  54.     waitfor "Enter Your Login: "
  55.     transmit "Larry^M"
  56.     waitfor "Password: "
  57.     transmit "Curly^M"
  58.     waitfor "Dialing 95551212"  ; the last statement by the dialback
  59.     transmit "+++"
  60.     pause 2 
  61.     transmit "ATH^M"            ; Hangup  (not required)
  62. endproc
  63.  
  64. proc login
  65.     ; The 'final' (or actual) login to the computer system
  66.     statmsg "Connected to Acme Soap Company"    
  67.     waitfor "login:"
  68.     transmit "Larry^M"
  69.     waitfor "Password: "
  70.     transmit "Moe^M"
  71.     exit
  72. endproc